#include<bits/stdc++.h>
#define ll long long
#define L(x) le[x]
#define R(x) re[x]
#define mid (l+r>>1)
#define lc(x) L(x),l,mid
#define rc(x) R(x),mid+1,r
#define OK Ll<=l&&r<=Rr
#define Root 1,1,n
#define rep(x,y,z) for(int x=(y);x<=(z);x++)
#define per(x,y,z) for(int x=(y);x>=(z);x--)
#define repn(x) rep(x,1,n)
#define repm(x) rep(x,1,m)
#define pb push_back
#define e(x) for(int i=h[x],y=to[i];i;i=nxt[i],y=to[i])
#define E(x) for(auto y:p[x])
#define Pi pair<int,int>
#define ui unsigned ll
inline int read(){int s=0,w=1;char c=getchar();while(c<48||c>57) {if(c=='-') w=-1;c=getchar();}while(c>=48&&c<=57)s=(s<<1)+(s<<3)+c-48,c=getchar();return s*w;}
inline void pf(ll x){if(x<0) putchar('-'),x=-x;if(x>9)pf(x/10);putchar(x%10+48);}
using namespace std;
const int N =1e6+5,M=1e6+5,inf=(1LL<<30)-1,mod=998244853;
const ll llf=1e18;
inline void add(int &a,int b){((a+=b)>=mod) and (a-=mod);}
inline int Add(int a,int b){return add(a,b),a;}
inline int mul(int a,int b){return 1LL*a*b%mod;}
inline void Mul(int &a,int b){a=mul(a,b);}
inline void red(int &a,int b){add(a,mod-b);}
inline int Red(int a,int b){return red(a,b),a;}
inline int qp(int a,int b){if(!b)return 1;int c=qp(a,b>>1);Mul(c,c);if(b&1)Mul(c,a);return c;}
inline int INV(int x){return qp(x,mod-2);}
int n,h[N],a[N],b[N],tot,lsh[N<<1],ba[N<<1],ln;
double hei[N],ans,w[N]; 
struct segment{
	double k,b;
}d[N<<3];
inline double get(int x,int id){
	if(!id)return -llf;
	return d[id].k*ba[x]+d[id].b;
}
int xd[N*20],le[N*20],re[N*20],Id[N<<3],cnt,ra,rb;
inline void pushdown(int x,int l,int r,int id){
	if(!xd[x])xd[x]=id;
	if(get(mid,id)>get(mid,xd[x]))swap(xd[x],id);
	if(get(l,id)>get(l,xd[x])){
		if(!L(x))L(x)=++cnt;
		pushdown(lc(x),id);
	}
	if(get(r,id)>get(r,xd[x])){
		if(!R(x))R(x)=++cnt;
		pushdown(rc(x),id);
	}
}
inline void modify(int x,int l,int r,int Ll,int Rr,int id){
	if(OK)return pushdown(x,l,r,id),void();
	if(Ll<=mid){
		if(!L(x))L(x)=++cnt;
		modify(lc(x),Ll,Rr,id);
	}
	if(Rr>mid){
		if(!R(x))R(x)=++cnt;
		modify(rc(x),Ll,Rr,id);
	}
}
inline double query(int x,int l,int r,int p){
	double ans=get(p,xd[x]);
	if(l==r)return ans;
	return max(ans,p<=mid?query(lc(x),p):query(rc(x),p));
}
double lw[N],bw[N];
int wn,wd[N];
inline void build(int x,int l,int r){
	Id[x]=++cnt;
	if(l==r)return;
	build(x<<1,l,mid),build(x<<1|1,mid+1,r);
}
inline double Get(int x,int id){
	if(!id)return -llf;
	return d[id].k*bw[x]+d[id].b;
}
inline void Pushdown(int x,int l,int r,int id){
	if(!xd[x])xd[x]=id;
	if(Get(mid,id)>Get(mid,xd[x]))swap(xd[x],id);
	if(Get(l,id)>Get(l,xd[x])){
		if(!L(x))L(x)=++cnt;
		Pushdown(lc(x),id);
	}
	if(Get(r,id)>Get(r,xd[x])){
		if(!R(x))R(x)=++cnt;
		Pushdown(rc(x),id);
	}
}
inline void Modify(int x,int l,int r,int p,int id){
	Pushdown(Id[x],1,wn,id);
	if(l==r)return;
	if(p<=mid)Modify(x<<1,l,mid,p,id);
	else Modify(x<<1|1,mid+1,r,p,id);
}
inline double que(int x,int l,int r,int p){
	double ans=Get(p,xd[x]);
	if(l==r||!xd[x])return ans;
	return max(ans,p<=mid?que(lc(x),p):que(rc(x),p));
}
inline double Query(int x,int l,int r,int Ll,int Rr,int p){
	if(OK)return que(Id[x],1,wn,p);
	if(Rr<=mid)return Query(x<<1,l,mid,Ll,Rr,p);
	if(Ll>mid)return Query(x<<1|1,mid+1,r,Ll,Rr,p);
	return max(Query(x<<1,l,mid,Ll,Rr,p),Query(x<<1|1,mid+1,r,Ll,Rr,p));
}
double t[N<<1];
inline void add_(int x,double k){
	while(x<=ln)t[x]=max(t[x],k),x+=x&-x;
}
inline double qry(int x){
	double ans=-llf;
	while(x)ans=max(t[x],ans),x-=x&-x;
	return ans;
}
double Mx;
inline void Main(){
	n=read();
	repn(i)h[i]=read(),lsh[i<<1]=a[i]=read(),lsh[(i<<1)-1]=b[i]=read(),lw[i]=w[i]=(double)h[i]/(double)(b[i]-a[i]);
	ans=h[1];
	sort(lsh+1,lsh+n*2+1),sort(lw+1,lw+n+1);
	repn(i)if(lw[i]!=lw[i+1])bw[++wn]=lw[i];
	rep(i,1,n<<1)if(lsh[i]^lsh[i+1])ba[++ln]=lsh[i];
	rep(i,1,ln)t[i]=-llf;
	repn(i)a[i]=lower_bound(ba+1,ba+ln+1,a[i])-ba,b[i]=lower_bound(ba+1,ba+ln+1,b[i])-ba,wd[i]=lower_bound(bw+1,bw+wn+1,w[i])-bw;
	ra=++cnt,rb=++cnt,build(1,1,ln);
	add_(b[1],h[1]);
	d[++tot]={w[1],-w[1]*ba[a[1]]},modify(ra,1,ln,1,b[1],tot);
	d[++tot]={w[1],-w[1]*ba[a[1]]},modify(rb,1,ln,1,b[1],tot);
	d[++tot]={(double)-ba[b[1]],(double)h[1]},Modify(1,1,ln,b[1],tot);
	rep(i,2,n){
		hei[i]=max({qry(a[i]),query(ra,1,ln,a[i]),query(rb,1,ln,b[i])-h[i],Query(1,1,ln,a[i],b[i],wd[i])+w[i]*ba[b[i]]-h[i],Mx});
		ans=max(ans,hei[i]+h[i]);
		add_(b[i],hei[i]+h[i]);
		d[++tot]={w[i],-w[i]*ba[a[i]]+hei[i]},modify(ra,1,ln,1,b[i],tot);
		d[++tot]={w[i],-w[i]*ba[a[i]]+hei[i]},modify(rb,1,ln,1,b[i],tot);
		d[++tot]={(double)-ba[b[i]],(double)h[i]+hei[i]},Modify(1,1,ln,b[i],tot);
		Mx=max(Mx,hei[i]);
	}
	printf("%.12lf",ans);
}
signed main(){
	freopen("wan.in","r",stdin);
	freopen("wan.out","w",stdout);
	int T=1;
	while(T--)Main(); 
//	cerr<<(double)clock()/CLOCKS_PER_SEC<<"seconds.";
	return 0;
}
